<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBillsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('bills', function (Blueprint $table) {
            $table->increments('id');
            $table->string('date')->index()->comment('账单日期');
            $table->unsignedInteger('service_id')->index()->comment('服务站ID');
            $table->unsignedInteger('network_id')->index()->comment('网点ID');
            $table->integer('total_sign')->default(0)->comment('派件(件)');
            $table->decimal('total_income', 10, 2)->default(0.00)->comment('总收入');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('bills');
    }
}
